﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PSI.Services;
using PSI.Models;
using PSI.Helper;

namespace PSI.Controllers
{
    public class BaseCodeAdminMetadataController :PSIBaseController 
    {
        //
        // GET: /BaseCodeAdminMetadata/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult AddMetadata(BaseCodeMetadata model) {

            var result = new BaseCodeMetadataService().AddMetadta(model);

            return Json(result);
        }

        [HttpPost]
        public ActionResult GetSing(string id) {

            var result = new BaseCodeMetadataService().GetItemSing(id);

            return Json(new { Data= result });
        }

        [HttpPost]
        public ActionResult GetMetadataItem(string queryKey) {

            var result = new BaseCodeMetadataService().GetItemForField(queryKey);
            return Json(result);
        }

    }
}
